home *** CD-ROM | disk | FTP | other *** search
- on mouseDown
- global MorphBase, stuckState, StretchFactor
- if doubleClick() then
- if stuckState < 0 then
- repeat with stuckState = stuckState to 0
- set the castNum of sprite clickOn() to MorphBase + stuckState
- updateStage()
- end repeat
- else
- if stuckState > 0 then
- repeat with stuckState = stuckState down to 0
- set the castNum of sprite clickOn() to MorphBase + stuckState
- updateStage()
- end repeat
- end if
- end if
- else
- set Hbase to mouseH()
- repeat while 1
- set deltaH to (mouseH() - Hbase) / StretchFactor
- set phase to stuckState + deltaH
- if phase < -17 then
- set phase to -17
- end if
- if phase > 17 then
- set phase to 17
- end if
- set the castNum of sprite clickOn() to MorphBase + phase
- updateStage()
- if not stillDown() then
- exit repeat
- end if
- end repeat
- set stuckState to phase
- end if
- end
-